﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Base.Schema;

namespace Base.DataModel
{
    public enum FieldletType
    {
        String,
        Text,
        Date,
        Int,
        Link
    }

    [SchemaElementName("fieldlet")]
    public class Fieldlet : IdentifiedItem
    {
        public Fieldlet(string name, Guid64 id, FieldletType type)
            : base(name, id)
        {
            this.Type = type;
        }

        public Fieldlet(string name, FieldletType type)
            : this(name, null, type)
        { }

        public Fieldlet(string name, Guid64 id)
            : this(name, id, FieldletType.String)
        { }

        public Fieldlet(string name)
            : this(name, null, FieldletType.String)
        { }

        [SchemaPreference("type")]
        public FieldletType Type { get; set; }

    }
}
